﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevComponents.DotNetBar.Metro;

namespace QLBH_N6
{
    public partial class DangNhap : DevComponents.DotNetBar.Metro.MetroForm
    {
        public string manv;
        public delegate void TruyenTS(string text);

        public DangNhap()
        {
            InitializeComponent();
        }

        private void DangNhap_Load(object sender, EventArgs e)
        {

        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            int a = int.Parse(nhanvien.SelectedItem.ToString().Substring(2,1));
            switch (a)
            {
                case 1:
                    if (matkhau.Text.Equals("111"))
                    {
                        manv = nhanvien.SelectedItem.ToString();
                        Form1 frm = new Form1();
                        TruyenTS truyen = new TruyenTS(frm.data);
                        truyen(manv);
                        frm.ShowDialog();
                    }
                    break;
                case 2:
                    if (matkhau.Text.Equals("222"))
                    {
                        manv = nhanvien.SelectedItem.ToString();
                        Form1 frm = new Form1();
                        TruyenTS truyen = new TruyenTS(frm.data);
                        truyen(manv);
                        frm.ShowDialog();
                    }
                    break;
                case 3:
                    if (matkhau.Text.Equals("333"))
                    {
                        manv = nhanvien.SelectedItem.ToString();
                        Form1 frm = new Form1();
                        TruyenTS truyen = new TruyenTS(frm.data);
                        truyen(manv);
                        frm.ShowDialog();
                    }
                    break;
                case 4:
                    if (matkhau.Text.Equals("444"))
                    {
                        manv = nhanvien.SelectedItem.ToString();
                        Form1 frm = new Form1();
                        TruyenTS truyen = new TruyenTS(frm.data);
                        truyen(manv);
                        frm.ShowDialog();
                    }
                    break;
                case 5:
                    if (matkhau.Text.Equals("555"))
                    {
                        manv = nhanvien.SelectedItem.ToString();
                        Form1 frm = new Form1();
                        TruyenTS truyen = new TruyenTS(frm.data);
                        truyen(manv);
                        frm.ShowDialog();
                    }
                    break;
                case 6:
                    if (matkhau.Text.Equals("666"))
                    {
                        manv = nhanvien.SelectedItem.ToString();
                        Form1 frm = new Form1();
                        TruyenTS truyen = new TruyenTS(frm.data);
                        truyen(manv);
                        frm.ShowDialog();
                    }
                    break;
                case 7:
                    if (matkhau.Text.Equals("777"))
                    {
                        manv = nhanvien.SelectedItem.ToString();
                        Form1 frm = new Form1();
                        TruyenTS truyen = new TruyenTS(frm.data);
                        truyen(manv);
                        frm.ShowDialog();
                    }
                    break;
                case 8:
                    if (matkhau.Text.Equals("888"))
                    {
                        manv = nhanvien.SelectedItem.ToString();
                        Form1 frm = new Form1();
                        TruyenTS truyen = new TruyenTS(frm.data);
                        truyen(manv);
                        frm.ShowDialog();
                    }
                    break;
            }
        }

    }
}
